<?php
/* @var $this UserController */
/* @var $model1 User */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'user-form',
	'htmlOptions'=>array('enctype'=>'multipart/form-data'),
	'enableAjaxValidation'=>false,
)); ?>

		<p class="note"><?php echo Yii::t('base','Fields with <span class="required">*</span> are required.');?></p>

	<?php // echo $form->errorSummary(array($model1,$model2)); ?>

	<div class="row">
		<?php echo $form->labelEx($model1,'user_name'); ?>
		<?php echo $form->textField($model1,'user_name',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model1,'user_name'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model1,'telephone'); ?>
		<?php echo $form->textField($model1,'telephone'); ?>
		<?php echo $form->error($model1,'telephone'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model1,'email'); ?>
		<?php echo $form->textField($model1,'email'); ?>
		<?php echo $form->error($model1,'email'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model1,'password'); ?>
		<?php echo $form->passwordField($model1,'password',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model1,'password'); ?>
	</div>
	<input size="60" maxlength="255" name="User[parentId]" id="User_parentId" type="hidden" value="0">	
	<div class="row">
		<?php echo $form->labelEx($model1,'level'); ?>
		<?php
			if($model1->level==""){
				echo $form->dropDownList($model1,'level',array(4=>Yii::t('base','Company'),'7'=>Yii::t('base','Person')));
			}else{
				echo $form->hiddenField($model1,'level',array('value'=>$model1->level));
			}
		?>
		<?php echo $form->error($model1,'level'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model2,'agent_type'); ?>
		<?php echo $form->dropDownList($model2,'agent_type',array('1'=>'一级代理商','2'=>'二级代理商','3'=>'三级代理商')); ?>
		<?php echo $form->error($model2,'agent_type'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model2,'credit');?>
		<?php echo $form->textField($model2,'credit');?>
		<?php echo $form->error($model2,'credit');?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model2,Yii::t('base','Filename')); ?>
		<?php echo CHtml::activeFileField($model2,'filename'); ?>
		<?php echo $form->error($model2,'filename'); ?>
	</div>
	<div class="row buttons">
		<?php echo CHtml::submitButton($model1->isNewRecord ? Yii::t('base','Create') : Yii::t('base','Save')); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->